package home;

public class homework {
    public static void main(String[] args) {
        try{
            if(args.length!=2 ){
                throw new ArrayIndexOutOfBoundsException("参数个数有问题");
            }
            int n1 = Integer.parseInt(args[0]);
            int n2=Integer.parseInt(args[1]);
            double res = fuck(n1, n2);
            System.out.println("计算结果为"+res);
        }catch(ArrayIndexOutOfBoundsException e){
            e.printStackTrace();
        }catch(NumberFormatException e){
            System.out.println("参数格式不正确需要输出整数");
        }catch(ArithmeticException e){
            System.out.println("出现除0的异常");
        }
        
        
    }
    public static double fuck(int n1,int n2){
        return n1/n2;
    }
}
